//
//  MainCollectionViewCell.m
//  云律司
//
//  Created by 韦淋 on 2017/6/22.
//  Copyright © 2017年 test. All rights reserved.
//

#import "MainCollectionViewCell.h"

@implementation MainCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self initializeInterface];
    }
    return self;
}
- (void)initializeInterface{
    [self.contentView addSubview:self.funcButton];
    [self.contentView addSubview:self.titleLable];
}
- (void)layoutSubviews{
    [super layoutSubviews];
    _funcButton.frame = CGRectMake(25, 5 , 25 , 25);
    _titleLable.frame = CGRectMake(0, 35, 80, 20);
}
#pragma mark -- Getter

- (UIButton *)funcButton{
    if (!_funcButton) {
        _funcButton = [[UIButton alloc]init];
        [_funcButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
//        _funcButton.backgroundColor = [UIColor redColor];
//        _funcButton.imageView.contentMode = UIViewContentModeScaleAspectFit;
        [_funcButton addTarget:self action:@selector(didClickFuncButton:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _funcButton;
}

- (UILabel *)titleLable{
    if (!_titleLable) {
        _titleLable = [[UILabel alloc] init];
//        _titleLable.backgroundColor = [UIColor blueColor];
        _titleLable.font = [UIFont systemFontOfSize:11];
        _titleLable.textAlignment = NSTextAlignmentCenter;
    }
    return _titleLable;
}
-(void)didClickFuncButton:(UIButton*)sender
{
    
    
    if ([self.delegate respondsToSelector:@selector(didClickFuncButtonAction:)]) {
        [self.delegate didClickFuncButtonAction:sender];
    }
}

@end
